<{include file="Public/top.html" }>
    </head>
    <body>
        <div id="warpper">
            <div class="content">
                <div class="location"><{if $type==1}>定时抽奖<{else}>满员抽奖<{/if}></div>
                <{if $type==1}><{include file="./timingNav.html" }><{else}><{include file="./fullNav.html" }><{/if}>
                <div class="filedSet" style="padding-bottom: 0;">
                    <form>
                        <div class="ui-form-item inline-block">
                            <dl>
                                <lable class="ui-label">目前期数：</lable>
                                <select class="ui-select" name="period" style="width: 120px;">
                                    <{html_options options=$periods selected=$obj.periods}>
                                </select>
                            </dl>
                            <dl>
                                <lable class="ui-label">新增期数：</lable>
                                <input class="ui-label" name="newPeriod" id="newPeriod" value="" style="width: 120px;height: 25px;border:1px solid #e5e5e5;"/>
                            </dl>
                            <div class="integral_btn-group">
                                <input type="submit" value="提交" class="ui-button" id="btn" style="margin-left:30%;"/>
                                <!--<input type="submit" value="清空" class="ui-button fade-o-butn"/>-->
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    <script>
        var url = "<{U('periodUpdate')}>";
        var type = "<{$type}>";
        var minPeriod = "<{$period}>";
        $("#btn").click(function(){
            var period = $('#newPeriod').val();
            var param={period:period,type:type};
            if(period==""){
                layer.msg("请输入新增期数后提交");
                return false;
            } else if(period <= minPeriod){
                layer.msg("新增期数应不小于已有期数");
                return false;
            }
            $.getJSON(url,param,function(data){
                if(data ==1){
                    layer.msg("期数更新失败，请重试");
                } else {
                    layer.msg("期数更新成功");
                    if(type==1){
                        window.location.href="<{U(timingNew)}>";
                    } else  window.location.href="<{U(fullNew)}>";
                }
            });
        });
    </script>
    </body>
<{include file="Public/foot.html" }>
</html>
